package demo1;

public class Main {
    public static void main(String[] args) {
        Printer printer = new colorPrinter();
        Printer printer1 = new bwPrinter();

        printer.print();
        printer1.print();
    }
}

class Printer{
    public void print(){

    }
}

class colorPrinter extends Printer{
    @Override
    public void print() {
        System.out.println("彩色打印");
    }
}

class bwPrinter extends Printer{
    @Override
    public void print() {
        System.out.println("黑白打印");
    }
}